#ifndef MEMORY_H
#define MEMORY_H

#include <stdio.h>
#include <stdlib.h>

void  jterminate(int exitcode);
void* jcalloc(size_t nmemb, size_t size, char* file, int line);
void* jmalloc(size_t size, char* file, int line);
void* jrealloc(void* ptr, size_t size, char* file, int line);
void  jfree(void *ptr);

typedef struct node {
    char*  file;
	int    line;
	void*  address;
	size_t length;
	struct node* next;
} MEMDATA;

typedef MEMDATA* MEMLIST;

#endif
